package com.javafour;

import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        // 声明变量
        boolean fileCorrect = false; 	//标识文件名是否正确
        boolean emailCorrect = false; 	//标识E-mail是否正确
        System.out.print("---欢迎进入作业提交系统---");
        Scanner input = new Scanner(System.in);
        System.out.println("请输入Java文件名: ");//1.java
        String fileName = input.next();
        System.out.print("请输入你的邮箱:");
        String email = input.next();

        String substring = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
        if(fileName.lastIndexOf(".") !=-1 &&
                substring.equals("com")  ){
            fileCorrect=true;
        }else {
            System.out.println("文件的名称不对....");
        }
        if(fileCorrect){
            System.out.println("作业提交成功...");
        }

    }
}
